package com.xongxong.admin.controller.login;


import com.xongxong.admin.domain.dto.loginDto;
import com.xongxong.admin.domain.po.User;
import com.xongxong.admin.service.IUserService;
import com.xongxong.admin.utils.Result;
import com.xongxong.admin.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dxx
 * @since 2024-10-15
 */
@CrossOrigin("*")
@RestController
@RequestMapping("/auth")
public class LoginController {
    @Autowired
    IUserService userService;
    @PostMapping("/login")
    public Result<User> list(@RequestBody loginDto loginDto){
        User login = userService.login(loginDto);
        return ResultUtil.success(login);
    }

}
